using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using LS.UnityExtensions.Editor;

namespace LS.GameKit.Editor
{
    [CustomEditor(typeof(SimpleTranslator))]
    public class SimpleTranslatorInspector : TransformerBehaviourInspector
    {
        protected SerializedProperty m_UsePhysicsBehaviour;
        protected SerializedProperty m_TranslateSpace;
        protected SerializedProperty m_ActivedTransform;
        protected SerializedProperty m_ActivedPhysicsBehaviour;
        protected SerializedProperty m_Start;
        protected SerializedProperty m_End;

        protected override void OnEnable()
        {
            base.OnEnable();
            m_UsePhysicsBehaviour = serializedObject.FindProperty("usePhysicsBehaviour");
            m_TranslateSpace = serializedObject.FindProperty("translateSpace");
            m_ActivedTransform = serializedObject.FindProperty("activedTransform");
            m_ActivedPhysicsBehaviour = serializedObject.FindProperty("activedPhysicsBehaviour");
            m_Start = serializedObject.FindProperty("start");
            m_End = serializedObject.FindProperty("end");
        }

        public override void DrawInspectorItems()
        {
            base.DrawInspectorItems();
            SimpleTranslator st = target as SimpleTranslator;
            EditorGUILayout.PropertyField(m_LoopType);
            EditorGUILayout.PropertyField(m_UsePhysicsBehaviour);
            EditorGUILayout.PropertyField(m_TranslateSpace);
            EditorGUILayout.PropertyField(m_ActivedTransform);
            EditorGUILayout.PropertyField(m_ActivedPhysicsBehaviour);
            PointSelectPositionField(m_Start,st.GetPosition);
            PointSelectPositionField(m_End, st.GetPosition);
        }
    }
}
